class NuttaphonThangkittisuwanTests extends GroovyTestCase {

	//HW3 unit tests for Nuttaphon Thangkittisuwan


	//------------------------------------------------------------
	// test the method that validates report input works
	// even if bad input is recieved (returns true if input
	// is valid, false if input is invalid)
	//------------------------------------------------------------


	// Test with having all data
    void testIsInputCompleteForReport_CompleteData() {

		def ac = new AdminController()
		def inputTest = [inputStart_day:"01",
						 inputStart_month:"01",
						 inputStart_year:"2007",
						 inputEnd_day:"01",
						 inputEnd_month:"01",
						 inputEnd_year:"2008"]

		assert ac.isInputCompleteForReport(inputTest) == true
    }


	// Test with missing day data
    void testIsInputCompleteForReport_MissingDay() {

		def ac = new AdminController()

		def inputMissing_StartDay= [ inputStart_month:"01",
									 inputStart_year:"2007",
									 inputEnd_day:"01",
									 inputEnd_month:"01",
									 inputEnd_year:"2008"]

		assert ac.isInputCompleteForReport(inputMissing_StartDay) == false
    }


	// Test with missing month data
	void testIsInputCompleteForReport_MissingMonth() {

		def ac = new AdminController()

		def inputMissing_StartMonth= [ inputStart_day:"01",
									 inputStart_year:"2007",
									 inputEnd_day:"01",
									 inputEnd_month:"01",
									 inputEnd_year:"2008"]

		assert ac.isInputCompleteForReport(inputMissing_StartMonth) == false
    }


	// Test with missing year data
	void testIsInputCompleteForReport_MissingYear() {

		def ac = new AdminController()

		def inputMissing_StartYear= [ inputStart_day:"01",
									 inputStart_month:"01",
									 inputEnd_day:"01",
									 inputEnd_month:"01",
									 inputEnd_year:"2008"]

		assert ac.isInputCompleteForReport(inputMissing_StartYear) == false
    }




}
